<?php /* Smarty version 2.6.26, created on 2018-07-05 15:55:29
         compiled from D:%5Cwww%5Cvweb/member%5Ctemplates/index/login.html */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('function', 'import', 'D:\\www\\vweb/member\\templates/index/login.html', 1, false),array('function', 'ads', 'D:\\www\\vweb/member\\templates/index/login.html', 4, false),array('function', 'uqcms', 'D:\\www\\vweb/member\\templates/index/login.html', 29, false),array('function', 'math', 'D:\\www\\vweb/member\\templates/index/login.html', 35, false),array('modifier', 'img_size', 'D:\\www\\vweb/member\\templates/index/login.html', 7, false),)), $this); ?>
<?php echo $this->_plugins['function']['import'][0][0]->import(array('file' => "index/reg_header.html",'title' => "会员登陆"), $this);?>

<div class="main_bar">
	<div class="lunbo">
		<?php echo $this->_plugins['function']['ads'][0][0]->load_ads(array('alias' => 'member_login','data' => 'bg_ads'), $this);?>

		<?php $_from = $this->_tpl_vars['bg_ads']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['i']):
?> 
			<?php if ($this->_tpl_vars['i']['type'] == '2'): ?>
				<a href="<?php echo $this->_tpl_vars['i']['link']; ?>
" target="_blank" style="background: url(<?php echo $this->_tpl_vars['__IMG__']; ?>
<?php echo ((is_array($_tmp=$this->_tpl_vars['i']['content'])) ? $this->_run_mod_handler('img_size', true, $_tmp, '1920x500') : $this->_plugins['modifier']['img_size'][0][0]->img_size($_tmp, '1920x500')); ?>
) center center;"></a>
			<?php endif; ?> 
		<?php endforeach; endif; unset($_from); ?> 
	</div>
	<div class="main">
	<form action="#" method="post">
		<div class="reg_box">
			<div class="bname"><span>用户登录</span></div>
			<div class="bcon">
				<div id="error_msg" style="display:none;"></div>
				<div class="binput"><i class="i1"></i><input type="text" name="username" placeholder="用户名/邮箱/电话号码" id="text"/></div>
				<div class="binput"><i class="i2"></i><input type="password" name="password" id="password" placeholder="密码"/></div>
				<div class="binput">
					<i class="i3"></i><input type="text" name="vcode" size="10" id="vcode" placeholder="验证码" maxlength="4"/>
					<a href="javascript:;" onClick="change_img()"><img id="vcode_img" src="index.php?m=ajax&a=vcode"/></a>
				</div>
				<div class="binput" style="border:none;"><input type="submit" name="submit" class="submit_login" value="登录"/></div>
			</div>
			<div class="login_reg_box">
				<a href="?a=forget" style="padding-right:30px;">忘记密码</a>
				<a href="?a=register">立即注册</a> 
			</div>
			<?php echo $this->_plugins['function']['uqcms'][0][0]->load_module(array('m' => 'api','v' => 'conn','c' => 'login_list'), $this);?>
 
			<?php if ($this->_tpl_vars['conn']): ?>
				<div class="sub_frm">
					<label style="color:#999999;">快捷方式登录：</label>
					<div class="sub_con">
						<?php $_from = $this->_tpl_vars['conn']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['i']):
?> 
							<a href="member.php?a=connect&alias=<?php echo $this->_tpl_vars['i']['alias']; ?>
&state=<?php echo smarty_function_math(array('equation' => "rand(0,10000)"), $this);?>
" class="connect"><img src="<?php echo $this->_tpl_vars['__PUBLIC__']; ?>
images/connect/32<?php echo $this->_tpl_vars['i']['alias']; ?>
.png"><span><?php echo $this->_tpl_vars['i']['name']; ?>
</span></a>
						<?php endforeach; endif; unset($_from); ?> 
					</div>
				</div>  
			<?php endif; ?>
		</div>
	</form>
	</div> 
</div>	
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "index/footer.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
<script type="text/javascript">
function GetQueryString(name){
     var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
     var r = window.location.search.substr(1).match(reg);
     if(r!=null)return  unescape(r[2]); return null;
}
$(function(){ 
	$('form').submit(function(){ 
		var username = $('input[name=username]').val();
		var password = $('input[name=password]').val(); 
		var vcode = $('#vcode').val(); 
		if(username == ''){$("#error_msg").show().html('用户名不能为空'); return false;} 
		if(password == ''){$("#error_msg").show().html('密码不能为空'); return false;} 
		if(vcode == ''){$("#error_msg").show().html('验证码不能为空'); return false;}
		$('.submit_login').attr("disabled", true).val('正在登陆..');
		$.ajax({
			type:'POST',
			url:'member.php?a=login_do',
			data:{username:username, password:password, vcode:vcode}, 
			success:function(result){
				var data = jQuery.parseJSON(result); 
				if(data.error == '0'){
					<?php if ($_GET['returnUrl']): ?>
						window.location.href=GetQueryString('returnUrl'); 
					<?php else: ?>
						window.location.href="member.php";
					<?php endif; ?> 
				}else{
					$("#error_msg").show().html(data.msg);
					$('.submit_login').attr("disabled", false).val('登陆');
					change_img();
				}
			},
			error:function(){
				alert('错误');
				$('.submit_login').attr("disabled", false).val('登陆');
			}
		});
		return false; 
	}); 
});
function change_img(){ 
	var timestamp = (new Date()).valueOf();
	var src = 'index.php?m=ajax&a=vcode&time='+timestamp;
	$("#vcode_img").attr('src',src);
} 
</script>